package tools;

import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;

/**
 * <p> TODU </P>
 *
 * @author yeager
 * @Version V1.1.1.0
 * @date 2023/11/24 10:35
 */
public class MTreeModel extends DefaultTreeModel {
    public MTreeModel(TreeNode root) {
        super(root);
    }

    public MTreeModel(TreeNode root,boolean asksAllowChildren){
        super(root, asksAllowChildren);
    }

    @Override
    public Object getChild(Object parent, int index) {
        return ((MTreeNode)parent).getHideAt(index);
    }

    @Override
    public int getChildCount(Object parent) {
        return ((MTreeNode)parent).getHideCount();
    }

    @Override
    public void removeNodeFromParent(MutableTreeNode node) {
        super.removeNodeFromParent(node);
    }
}
